from django.forms.widgets import Widget

class GMap(Widget):
    input_type = 'map'
    
    def render(self, name, value, attrs=None):
        if value is None: value = ''
        final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)
        if value != '':
            # Only add the 'value' attribute if a value is non-empty.
            final_attrs['value'] = force_unicode(value)
        return mark_safe(u'<div><input type="text" %s /></div>' % flatatt(final_attrs))